package org.waveplayer.section.decoration;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.Objects;

public class Section {

    public String id;
    public String title;

    /**
     * 可以用它放一些额外的内容，以便在自定义{@link SectionPainter}获取使用
     */
    private Object tag;

    public Section(@NonNull String id, String title) {
        this.id = id;
        this.title = title;
    }

    public void setTag(@Nullable Object tag) {
        this.tag = tag;
    }

    @Nullable
    public Object getTag() {
        return tag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Section section = (Section) o;
        return Objects.equals(id, section.id);
    }
}
